<%@ page import="dao.StudentDao" %>
<%@ page import="dao.impl.StudentDaoImpl" %><%--
  Created by IntelliJ IDEA.
  User: 钱多多的钱罐罐
  Date: 2022/3/23
  Time: 16:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        String flag = request.getParameter("flag");
        if (flag.equals("delete")) {
            String studentno = request.getParameter("studentno");
            StudentDao dao = new StudentDaoImpl();
            int id = Integer.parseInt(studentno);
            int count = dao.delete(id);
            if (count > 0) {
                response.sendRedirect("index2.jsp");
            } else {
                response.sendRedirect("error.jsp");

            }
        }


    %>
</body>
</html>
